package edu.sandau.b23015110.mapper;

import edu.sandau.b23015110.model.Customer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CustomerMapper {

    List<Customer> findAll(Customer customer);

    @Delete("delete from customer where id = #{id}")
    void deleteById(String id);

    @Insert("insert into customer(id,name,major) values(#{id},#{name},#{major})")
    void save(Customer s);

    @Update("update customer set name = #{name},major= #{major} where id = #{id}")
    void update(Customer s);

    @Select("select * from customer where id = #{id}")
    Customer getReferenceById(String id);
}
